package com.xiweicheng.test.springcloud.ms.a;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

@Component
@Slf4j
public class Sender {

    @Autowired
    AmqpTemplate rabbitTemplate;

    public void send() {

        String msg = "hello " + new Date();

        log.debug("Sender: " + msg);

        rabbitTemplate.convertAndSend("hello", msg);
    }
}
